#

shopping_list = [
    ("增发液",1150),
    ("防脱发洗发水",425),
    ("发际线填充粉",250),
    ("假发",920),
    ("生发片",1160),
    ("帽子",220),
    ("生发胶囊",1300),
    ("维生素H",680),
]
shopping_car=[]
zhifubao=input("请输入您的支付宝余额：")
if zhifubao.isdigit():
    zhifubao=int(zhifubao)
    while True:
        for item in shopping_list:
            print(shopping_list.index(item),item)
        choice=input("请输入您想购买的商品编号：")
        if choice.isdigit():
            choice=int(choice)
            if choice>=0 and choice<=8:
                if zhifubao>= shopping_list[choice][1]:
                    zhifubao = zhifubao-shopping_list[choice][1]
                    shopping_car.append(shopping_list[choice])
                    print("已为您把%s添加到购物车，您的余额还有%s。"%(shopping_list[choice][0],zhifubao))
                else:
                    print("您的支付宝余额不足，请选择其他商品或先充值")
            else:
                print("您选择的商品不在商品列表里面，请输入正确的商品信息")
        elif choice == "quit":
            print("-----购物车清单-----")
            for item in shopping_car:
                print(item)
            print("您的支付宝余额是%s" % zhifubao)
            break
else:
    print("请输入支付宝余额")